package com.hhsjdesign.dynamicui.businessdata

/**
 * 通用业务 item 需要的业务数据模型，包装了接口数据
 */
open class IViewable<T> {

    //视图唯一Id，这个唯一性由后端处理。
    var viewId: String? = null

    //所属组件id，传递过来的
    var widgetId: String? = null

    //id链，运算得来的
    var treeId: String? = null

    //泛型数据
    var businessData: T? = null

    //背景网络图
    var imageUrl: String? = null

    //背景颜色
    var bgColor: String? = null

    //标题
    var title: String? = null

    //标题2
    var title2: String? = null

    //描述
    var description: String? = null

    //功能图标
    var funIcon: String? = null

    //功能图标2
    var funIcon2: String? = null

    //消息编码
    var msgCode: String? = null

    fun businessData(): T? {
        return businessData
    }

    //转换成IViewable
    interface IViewableTransformer {
        fun toViewable(): IViewable<*>?
    }

    //用于管理红点的
    interface IRedDotTree {
        fun treeId(parentId: String?, treeId: String?)
    }

}